import xlwt

class XmlGenerator:

    def __init__(self):
        self.workbook = xlwt.Workbook(encoding = 'utf-8')
        self.worksheet = self.workbook.add_sheet('待翻译')
        # 标题
        self.worksheet.write(0, 0, "Key")
        self.worksheet.write(0, 1, "英文")
        self.worksheet.write(0, 2, "波兰语")
        self.rowIndex = 1
    def increase_row_index(self):
        self.rowIndex += 1
    def reset_row_index(self):
        self.rowIndex = 1
    def write(self, text0, text1, text2):
        if text0 != None:
            self.worksheet.write(self.rowIndex, 0, label = text0)
        if text1 != None:

            self.worksheet.write(self.rowIndex, 1, label = text1)
        if text2 != None:
            self.worksheet.write(self.rowIndex, 2, label = text2)
        self.increase_row_index()
    def done(self):
        self.workbook.save('Android 波兰语缺失文案.xls')
